IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spSys_UserIsValid')
	BEGIN
		DROP  Procedure  spSys_UserIsValid
	END
GO
-- =============================================
-- Author:		NAMTRANPHUONG
-- Create date: August 18, 2012
-- Description:	Select Role infor
-- =============================================
CREATE PROCEDURE spSys_UserIsValid
	@UserName NVARCHAR(200),
	@Password NVARCHAR(32)
AS
BEGIN
	DECLARE @IsValid BIT
	IF EXISTS(
	SELECT UserId
	FROM Sys_User
	WHERE Username = @UserName AND [Password] = @Password)	
		SET @IsValid = 1	
	ELSE
		SET @IsValid = 0
	SELECT @IsValid	
END
GO
